package cn.com.yang.thread;

import java.util.Date;

public class MyThread extends Thread{
	private long pauseTime;
	private String threadName;
	public static int ant =100;
	
	public MyThread(long pauseTime, String threadName) {
		this.pauseTime = pauseTime;
		this.threadName = threadName;
	}
	public void run() {
		while(true) {
			System.out.println(threadName + ":" + new Date(System.currentTimeMillis()));
			try {
				Thread.sleep(pauseTime);
				//System.out.print(MyThread.ant);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			
		}
	}
	public static void main(String[] args) {
		MyThread t1 = new MyThread(1000, "First thread");
		t1.start();
		MyThread t2 = new MyThread(3000, "Second thread");
		t2.start();
	}
}

